home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc1_2_x / popupmen.sit / PopUpMenu 2.0b2 / card_4186.txt < prev    next >
Text File  |  1989-09-13  |  2KB  |  73 lines

  1. -- card: 4186 from stack: in.0b2
  2. -- bmap block id: 0
  3. -- flags: 4000
  4. -- background id: 3155
  5. -- name: 
  6. ----- HyperTalk script -----
  7. -----------------------------------------------------------------------
  8. -- openCard
  9. -----------------------------------------------------------------------
  10. on openCard
  11.   global font, fonts
  12.  
  13.   put "Geneva,Monaco,Chicago" into fonts
  14.  
  15.   put 3 into font
  16.   set the textFont of card button "Example" to item font of fonts
  17.  
  18.   pass openCard
  19. end openCard
  20.  
  21.  
  22. -----------------------------------------------------------------------
  23. -- doPopUp
  24. -----------------------------------------------------------------------
  25. on doPopUp
  26.   global font, fonts
  27.  
  28.   get PopUpMenu( fonts, font )
  29.  
  30.   if it is not empty then
  31.     put it into font
  32.     set the textFont of the target to item font of fonts
  33.   end if
  34. end doPopUp
  35.  
  36.  
  37. -- part 1 (button)
  38. -- low flags: 00
  39. -- high flags: A004
  40. -- rect: left=278 top=157 right=179 bottom=378
  41. -- title width / last selected line: 0
  42. -- icon id / first selected line: 0 / 0
  43. -- text alignment: 1
  44. -- font id: 0
  45. -- text size: 12
  46. -- style flags: 0
  47. -- line height: 16
  48. -- part name: Example
  49. ----- HyperTalk script -----
  50. on mouseDown
  51.   doPopUp
  52. end mouseDown
  53.  
  54.  
  55. -- part contents for background part 10
  56. ----- text -----
  57. A typical script using this external function might be
  58.  
  59. ┬á┬áon mouseDown
  60.  
  61. ┬á┬á┬á┬áput "Geneva,Monaco,Chicago" into fonts
  62.  
  63. ┬á┬á┬á┬áget PopUpMenu(┬áfonts┬á)
  64.  
  65. ┬á┬á┬á┬áif it is not empty then
  66. ┬á┬á┬á┬á┬á┬áset the textFont of ΓǪ to item it of fonts
  67. ┬á┬á┬á┬áend if
  68.  
  69. ┬á┬áend mouseDown
  70.  
  71. DonΓÇÖt forget to look at the help stackΓÇÖs scripts for other examples.
  72.  
  73.